package com.ruoyi.datastatistics.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 开账明细对象 t_bill_detail
 *
 * @author zt
 * @date 2025-05-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_bill_detail")
public class BillDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 开账主键 */
    @TableId(value="id",type = IdType.AUTO)
    private Long id;

    /** 能耗分类（从数据字典获取） */
    @Excel(name = "能耗分类", dictType = "energy_use_classification", dictTypeOnlyForExport = true,sort = 5)
    @TableField("energy_use_classification")
    private String energyUseClassification;

    /** 用户编号 */
    @Excel(name = "用户编号",sort = 2)
    @TableField("user_id")
    private String userId;

    @TableField("tenant_id")
    private String tenantId;

    /** 表编号 */
    @Excel(name = "表编号",sort = 3)
    @TableField("terminal_id")
    private String terminalId;

    /** 起始抄表读数 */
    @Excel(name = "起始读数",sort = 6)
    @TableField("start_reading")
    private BigDecimal startReading;

    /** 终止抄表读数 */
    @Excel(name = "结束读数", sort = 7)
    @TableField("end_reading")
    private BigDecimal endReading;

    /** 用量 */
    @Excel(name = "用量", sort = 8)
    @TableField("total_val")
    private BigDecimal totalVal;

    /** 单价 */
    @Excel(name = "单价",sort = 9)
    @TableField("unit_price")
    private BigDecimal unitPrice;

    /** 违约金 */
    // @Excel(name = "违约金")
    @TableField("late_fee")
    private BigDecimal lateFee;

    /** 抄表时间 */
    @Excel(name = "日期",sort = 1)
    @TableField("read_date")
    private String readDate;

    /** 状态(0:未核销 1:已核销) */
    // @Excel(name = "状态(0:未核销 1:已核销)")
    @TableField("status")
    private Integer status;
    @TableField("location_nb")
    private String locationNb;

    @Excel(name = "总价", sort = 10)
    @TableField("total_price")
    private BigDecimal totalPrice;

    @TableField("frequency_type")
    private BigDecimal frequencyType;

    @TableField("start_reading_time")
    private Date startReadingTime;

    @TableField("end_reading_time")
    private Date endReadingTime;

    @TableField(exist = false)
    @Excel(name = "设备名称", sort = 4)
    private String installAddress;

    @TableField("frozen_type")
    private String frozenType;





    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("energyUseClassification", getEnergyUseClassification())
            .append("userId", getUserId())
            .append("terminalId", getTerminalId())
            .append("startReading", getStartReading())
            .append("endReading", getEndReading())
            .append("totalVal", getTotalVal())
            .append("unitPrice", getUnitPrice())
            .append("lateFee", getLateFee())
            .append("readDate", getReadDate())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
